/**
 * 
 */
package com.jeecg.p3.dzdp.dao.impl;

import java.util.List;
import java.util.Map;

import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.PageQueryWrapper;
import org.jeecgframework.p3.core.utils.persistence.mybatis.GenericDaoDefault;
import org.springframework.stereotype.Repository;

import com.google.common.collect.Maps;
import com.jeecg.p3.dzdp.dao.WxActDzdpRelationDao;
import com.jeecg.p3.dzdp.entity.WxActDzdpRelation;
@Repository("WxActDzdpRelationDaoImpl")
public class WxActDzdpRelationDaoImpl extends GenericDaoDefault<WxActDzdpRelation> implements WxActDzdpRelationDao {

	@Override
	public Integer count(PageQuery<WxActDzdpRelation> pageQuery) {
		return (Integer) super.queryOne("count",pageQuery);
	}

	@Override
	public List<WxActDzdpRelation> queryPageList(PageQuery<WxActDzdpRelation> pageQuery, Integer itemCount) {
		PageQueryWrapper<WxActDzdpRelation> wrapper=new PageQueryWrapper<WxActDzdpRelation>(pageQuery.getPageNo(),pageQuery.getPageSize(),itemCount,pageQuery.getQuery());
		return (List<WxActDzdpRelation>)super.query("queryPageList",wrapper);
	}
	@Override
	public void batchDeleteByPropertyId(String propertyId){
		Map<String,String> params=Maps.newConcurrentMap();
		params.put("propertyId", propertyId);
		super.delete("batchDeleteByPropertyId",params);
	}
	
	@Override
	public void batchDeleteOldOpts(List<String>ids,String propertyId){
		Map<String,Object> params=Maps.newConcurrentMap();
		params.put("ids", ids);
		params.put("propertyId", propertyId);
		super.delete("bactchDeleteOldopts",params);
	}
	public List<WxActDzdpRelation> queryByPropertyId(String propertyId){
		Map<String,String> param = Maps.newConcurrentMap();
		param.put("propertyId", propertyId);
		return (List<WxActDzdpRelation>)super.query("queryByPropertyIdAndJwid",param);
	}
}
